﻿@{
    ViewBag.Title = "新增地址";
    Layout = "~/Views/Shared/_layoutPersonal.cshtml";
}
@Styles.Render("~/Content/css/addAddress")

<article class="main">
    <nav class="mod_nav">
        <div class="lay_left">
            <a class="nav_back" onclick="turnBack()"><img src="/images/TurnBackNormal.png"></a>
            <span>新增地址</span>
        </div>
    </nav>
    <div class="alert alert-warning" style="display:none" role="alert">
        <strong></strong>
    </div>
    <section class="mod_input">
        <ul>
            <li>
                <label>联系人</label><input id="userName" placeholder="姓名" type="text">
            </li>
            <li class="check">
                <a>
                    <span id="man" class="Input_check input_checked"></span>
                    <span>先生</span>
                </a>
                <a>
                    <span id="woman" class="Input_check input_uncheck"></span>
                    <span>女士</span>
                </a>
            </li>
            <li>
                <label>地址</label><input id="address" type="text" placeholder="详细收货地址">
            </li>
            <li>
                <label>手机号</label><input id="phoneNumber" type="tel" placeholder="配送人员联系您的电话">
            </li>
        </ul>
    </section>
    <section class="mod_btn">
        <a class="btn_save" onclick="addAddress()">保存</a>
    </section>
</article>

<script>
    function addAddress() {
        var deliveryAddrTemp = getTempSaveDeliveryAddress(null);
        if (null != deliveryAddrTemp) {
            DeliveryAddrMgr.saveDeliveryAddr(deliveryAddrTemp, saveDeliveryAddrCallback);
        }
    }

    function turnBack() {
        window.location.href = '@Url.Content("~/")' + 'DeliveryAddr/Index';
    }
</script>